package com.clstu.homework;

import java.io.Serializable;

public class Dog implements Serializable {//实现可序列化接口，才能够被序列化
    private String name;
    private int age;
    private transient String color;
    private static final long serialVersionUID = 3L;//版本号，提高兼容性

    public Dog(String name, int age, String color) {
        this.name = name;
        this.age = age;
        this.color = color;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    @Override
    public String toString() {
        return  "name='" + name + '\'' +
                ", age=" + age +
                ", color='" + color;
    }
}
